<?php
/**
 * 由清馨雅致基于绛木子仿简书主题最新版修改。
 * 你可以访问<a href="http://minwenlsm.pw/">Min's博客</a>查看详情。
 * 版权所有 &copy; 2015-2016 绛木子 保留一切权利！
 *
 * @package <font color="#4A89DC">JianShu(变异版)</font>
 * @author 绛木子、<a href="http://minwenlsm.pw/">清馨雅致</a>
 * @version <font color="#F40">1.6</font>
 * @link http://lixianhua.com
 *
 */

if (!defined('__TYPECHO_ROOT_DIR__')) exit;
if(!$this->request->isAjax() || !is_pjax())
	$this->need('header.php');
?>
<title><?php $this->archiveTitle(array(
		'category'  =>  _t('分类：%s'),
		'search'    =>  _t('搜索：%s'),
		'tag'       =>  _t('标签：%s'),
		'author'    =>  _t('%s 发布的文章')
	), '', ' - '); ?><?php $this->options->title(); ?></title>
<div id="wrapper" class="clearfix">
	<div id="cover">
		<div class="cover-img" style="background-image:url('<?php if ($this->options->bgPhoto){$photo = explode(',',$this->options->bgPhoto);echo $photo[array_rand($photo,1)];}else{$this->options->themeUrl('img/header_'.rand(1,31).'.jpg');}?>')"></div>
		<div class="cover-info">
			<img class="avatar" width="72" src="<?php $this->options->avatarUrl();?>" alt="" />
			<h3><?php $this->options->title(); ?></h3>
			<p><?php $this->options->description(); ?></p>
			<div class="cover-sns">
				<div class="btn btn-weibo">
					<a href="javascript:void(0);"><i class="fa fa-weibo"></i></a>
					<div class="qrcode"><img src="<?php $this->options->themeUrl('img/site.png'); ?>" alt="" width="100px"/></div>
					<div class="qrcode-arrow"></div>
				</div>
				<div class="btn btn-weixin">
					<a class="" href="javascript:void(0);"><i class="fa fa-weixin"></i></a>
					<div class="qrcode"><img src="<?php $this->options->themeUrl('img/wx.png'); ?>" alt="" width="120px"/></div>
					<div class="qrcode-arrow"></div>
				</div>
			</div>
		</div>
	</div>
	<div class="body" id="body">
		<div class="main" id="main">
			<div class="page-title">
				<ul>
					<li <?php if($this->is('index')): ?>class="active"<?php endif; ?>><a href="<?php $this->options->siteUrl(); ?>">最新</a></li>
					<?php if($this->is('post')): ?>
						<li class="active">
							<?php $categories = $this->categories;
							if($categories):
								?>
								<a href="<?php _e($categories[0]['permalink']); ?>"><?php _e($categories[0]['name']); ?></a>
							<?php endif; ?>
						</li>
					<?php endif; ?>
					<?php if($this->is('archive')):?>
						<li class="active">
							<a href="javascript:jBlog.goTop();"><?php _e($this->getArchiveTitle()); ?></a>
						</li>
					<?php endif; ?>
					<li><a href="javascript:jBlog.ajaxGetExplore();" title="<?php _e('随机显示一篇文章');?>"><?php _e('探索');?></a></li>
					<li class="page-search">
						<form id="search" method="post" action="./" role="search">
							<label for="s" class="sr-only"><?php _e('搜索关键字'); ?></label>
							<input type="text" name="s" class="text" placeholder="<?php _e('输入关键字搜索'); ?>" />
							<button type="submit" class="submit" title="<?php _e('搜索'); ?>"><i class="fa fa-search"></i></button>
						</form>
					</li>
				</ul>
			</div>
			<div class="main-inner">
				<?php while($this->next()): ?>
					<article class="post">
						<?php if (!empty($this->options->listStyle) && in_array('thumb', $this->options->listStyle)):?>
							<?php Tools_Plugin::thumbnail($this);?>
						<?php endif; ?>
						<div class="post-header">
							<div class="post-meta"><a href="<?php $this->author->permalink(); ?>"><strong><?php $this->author(); ?></strong></a><em>·</em><?php $this->dateWord(); ?></div>
							<a class="post-title" href="<?php $this->permalink() ?>" title="<?php $this->title() ?>"><?php $this->title(); ?></a>
							<div class="post-meta">
								<a href="<?php $this->permalink() ?>"><?php _e('阅读：'); $this->viewsNum(); ?></a><em>·</em>
								<?php if ($this->options->comment == 'comments'): ?>
									<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论：%d'); ?></a><em>·</em>
								<?php endif; ?>
								<?php if ($this->options->comment == 'comments_duoshuo'): ?>
									<a href="<?php $this->permalink() ?>" class="ds-thread-count" data-thread-key="<?php $this->cid(); ?>"></a><em>·</em>
								<?php endif; ?>
								<span><?php _e('喜欢：'); $this->likesNum(); ?></span>
							</div>
						</div>
						<?php if (!empty($this->options->listStyle) && in_array('excerpt', $this->options->listStyle)):?>
							<div class="post-desc"><?php $this->description(); ?></div>
						<?php endif; ?>
						<?php if(!empty($this->options->listStyle) && in_array('more',$this->options->listStyle)): ?>
							<?php $this->content('- 阅读剩余部分 -'); ?>
						<?php endif; ?>
					</article>
				<?php endwhile; ?>

			</div>
			<?php if($this->getTotalPage()>1):?>
				<div id="btn-archive">
					<div class="btn"><?php $this->pageLink('点击查看更多','next');?></div>
				</div>
			<?php endif; ?>
		</div><!-- end #main-->
		<script>
			function jBlogInit() {
				jBlog.initPjax({
					url:'<?php $this->options->siteUrl();?>',
					action:'<?php $this->options->index('action');?>',
					current:'<?php echo $this->getArchiveType();?>',
					prefix:'<?php echo md5($this->options->rootUrl);?>',
				});
			}
		</script>
	</div><!-- end #body -->
</div>
<?php if(!$this->request->isAjax() || !is_pjax()) $this->need('footer.php'); ?>
